Skip to content

Add V3 billing opt-out functionality with admin-only deployment restrictions#1067

Merged
xmonader merged 8 commits into
developmentfrom
development-feat-v3-billing-opt-out
Feb 19, 2026
Merged

Add V3 billing opt-out functionality with admin-only deployment restrictions#1067
xmonader merged 8 commits into
developmentfrom
development-feat-v3-billing-opt-out

Conversation

@sameh-farouk
Copy link
Copy Markdown
Member

@sameh-farouk sameh-farouk commented Feb 18, 2026

PR: feat: v3 billing opt-out for node migration

Summary

Implement node-level V3 billing opt-out mechanism allowing farmers to exempt nodes from billing while restricting deployments to authorized twin admins.


Changes

pallet-tfgrid

  • New NodeV3BillingOptOut storage map (node_id → opted_out_at) and AllowedTwinAdmins storage value
  • New extrinsics: opt_out_of_v3_billing (farmer-callable), add_twin_admin / remove_twin_admin (council-gated)
  • Cleanup of NodeV3BillingOptOut on node deletion
  • Benchmark cases + weight stubs for the 3 new extrinsics

pallet-smart-contract

  • Deployment guard in _create_node_contract and _create_rent_contract: only allowed twin admins can deploy on opted-out nodes (OnlyTwinAdminCanDeployOnThisNode error)
  • Billing suppression in bill_contract: zero cost for Created/GracePeriod/Deleted states on opted-out nodes; Created contracts return early to avoid unnecessary reserve/remit work

Tests: 11 new tests in pallet-tfgrid, 9 new tests in pallet-smart-contract — all passing, no regressions.


Notes

  • No storage migrations required (new storage items, additive only)
  • Weight stubs are temporary estimates; regeneration via benchmark github workflow is a follow-up

Related Issues:

  • Closes # (issue number, if applicable)

Checklist:

Please delete options that are not relevant.

  • My change requires a change to the documentation and I have updated it accordingly
  • I have added tests to cover my changes.

sameh-farouk and others added 8 commits February 18, 2026 18:39
…ictions

Implement node-level V3 billing opt-out mechanism allowing farmers to exempt nodes from billing while restricting deployments to authorized twin admins. Add storage maps for opt-out tracking and admin list management. Include billing suppression logic for opted-out nodes in Created state, with zero-cost calculations for both standard and additional fees.
Implement client methods for V3 billing opt-out functionality including OptOutOfV3Billing, AddTwinAdmin, RemoveTwinAdmin, GetAllowedTwinAdmins, and IsNodeOptedOutOfV3Billing. Add corresponding event types NodeV3BillingOptedOut, TwinAdminAdded, and TwinAdminRemoved. Include comprehensive unit tests and update error definitions for new tfgrid and smart contract module errors.
@sameh-farouk sameh-farouk marked this pull request as ready for review February 19, 2026 12:39
@xmonader xmonader merged commit 1c75b57 into development Feb 19, 2026
1 of 5 checks passed
@xmonader xmonader deleted the development-feat-v3-billing-opt-out branch February 19, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants